export default {
    onPageLoad(query) {
        //console.log('---------> LifeCycle onPageLoad', query)
        // 获取系统信息
        const systemInfo = wx.getSystemInfoSync();
        // 胶囊按钮位置信息
        const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
        // 导航栏高度 = 状态栏到胶囊的间距（胶囊距上距离-状态栏高度） * 2 + 胶囊高度 + 状态栏高度
        $page.state.navBarHeight = (menuButtonInfo.top - systemInfo.statusBarHeight) * 2 + menuButtonInfo.height + systemInfo.statusBarHeight;
        $page.state.menuHeight = menuButtonInfo.height;

        // 获取每个栏目的高度
        const querys = wx.createSelectorQuery();
        querys.select('#uuid_71f43214').boundingClientRect((res) => {
            $page.state.navTopBox = res.height - 10
        }).exec();
        //uuid_71f43214


    },
    onPageShow() {
        //console.log('---------> LifeCycle onPageShow')
        // 首页跳转分类
        let ct = wx.getStorageSync("currentTab");

        if (ct != "") {
            $page.state.currentId = ct;
            switch (ct) {
                case "ylfw":
                    $page.state.cardId = "uuid_b434c550-" + 3;
                    break;
                case "rcjy":
                    $page.state.cardId = "uuid_b434c550-" + 4;
                    break;
                case "shfw":
                    $page.state.cardId = "uuid_b434c550-" + 1;
                    break;
                default:
                    $page.state.cardId = "uuid_b434c550-" + 0;
            }
            wx.removeStorageSync("currentTab");
        }

        // 获取每个栏目的高度
        const query = wx.createSelectorQuery();
        query.select('#uuid_de963015').boundingClientRect((res) => {
            $page.state.top = res.top;
            console.log('$page.state.top: ', $page.state.top);
        }).exec();

    },
    onPageReady() {
        //console.log('---------> LifeCycle onPageReady')
    },
    onPageHide() {
        //console.log('---------> LifeCycle onPageHide')
    },
    onPageUnload() {
        //console.log('---------> LifeCycle onPageUnload')
    },
};
